package com.weimei.conversionTreasure.viewModel;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableField;
import androidx.databinding.ObservableList;

import com.chad.library.BR;
import com.weimei.conversionTreasure.R;
import com.weimei.conversionTreasure.http.entity.YMonthDetailBean;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.ItemViewModel;
import me.tatarka.bindingcollectionadapter2.ItemBinding;

public class YMonthDetailItemVM extends ItemViewModel {
    public ObservableField<YMonthDetailBean.DataDTO.RDayDTO> entity = new ObservableField<>();

    public ObservableList<YMonthDetailItemIVM> observableList = new ObservableArrayList<>();
    public ItemBinding<YMonthDetailItemIVM> itemBinding = ItemBinding.of(BR.viewModel, R.layout.item_y_d_c);

    public YMonthDetailItemVM(@NonNull BaseViewModel viewModel, YMonthDetailBean.DataDTO.RDayDTO data) {
        super(viewModel);
        entity.set(data);
        for (YMonthDetailBean.DataDTO.RDayDTO.DealDataDTO bean:data.getDealData()) {
            YMonthDetailItemIVM itemIVM = new YMonthDetailItemIVM(viewModel,bean);
            observableList.add(itemIVM);

        }

    }
}
